From: Florian Müllner Date: Tue, 12 Jun 2012 22:44:29 +0000 (+0200) Subject: userMenu: Make presence chooser insensitive when offline X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6094 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cd43c4983b56fa475b477e2d049262059ca9e65f;p=gnome-shell.git userMenu: Make presence chooser insensitive when offline Setting an IM presence only makes sense when connected to the network, reflect this by making the presence chooser insensitive when no network is available. https://bugzilla.gnome.org/show_bug.cgi?id=677982 --- diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js index ce4f8ca1a..f113664aa 100644 --- a/js/ui/userMenu.js +++ b/js/ui/userMenu.js @@ -216,6 +216,8 @@ const IMStatusChooserItem = new Lang.Class({ this._networkMonitor = Gio.NetworkMonitor.get_default(); this._networkMonitor.connect('network-changed', Lang.bind(this, function(monitor, available) { + this._IMAccountsChanged(this._accountMgr); + if (available && !this._imPresenceRestored) this._restorePresence(); })); @@ -303,7 +305,8 @@ const IMStatusChooserItem = new Lang.Class({ let accounts = mgr.get_valid_accounts().filter(function(account) { return account.enabled; }); - this._combo.setSensitive(accounts.length > 0); + let sensitive = accounts.length > 0 && this._networkMonitor.network_available; + this._combo.setSensitive(sensitive); }, _IMStatusChanged: function(accountMgr, presence, status, message) {